<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- 引入 layui.css -->
  <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
  <title>志愿者页面</title>
  <script src="js/jquery.min.js"></script>
</head>

<body>
  <div class="layui-panel" style="display:flex">
    <div
      style="padding: 30px;border: 2px solid rgb(3, 3, 3);border-radius: 15px;width: 100px;text-align: center;height: 20px;margin: 20px;">
      志愿者页面</div>
    <table class="layui-hide" id="test"></table>
  </div>

</body>
<!-- 引入 layui.js -->
<script src="//unpkg.com/layui@2.6.8/dist/layui.js" />
<script src="js/jquery.min.js"></script>
<script>
  console.log($("#sportList"));
  layui.use('table', function () {
    var table = layui.table;
    table.render({
      elem: '#test',
      url: 'http://localhost:8080/getIsInjured',
      parseData: function (res) {
        console.log(res);
        //res 即为原始返回的数据
        return {
          "code": 0, //解析接口状态
          "msg": '', //解析提示文本
          "count": res.length, //解析数据长度
          "data": res //解析数据列表
        };
      },
      //全局定义常规单元格的最小宽度，layui 2.2.1 新增
      cellMinWidth: 200,
      cols: [
        [{
          field: 'username',
          width: 500,
          title: '受伤运动员名称',
          sort: true
        }, 
        // {
        //   field: 'isInjured',
        //   width: 500,
        //   title: '已受伤',
        // }
      ]
      ]
    });
  });
</script>

</html>